#include <QCoreApplication>
#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    double A[100];
    int E=0;
    cout<<"Vvedite E: ";
    cin>>E;
    int i=0;
    A[0]=2;
    for(int i=1;i<100;i++)
    {
        A[i]=2+1/A[i-1];
    }
    while ((A[i]-A[i-1])>E)
    {
        i++;
    }
    cout<<"E= "<<E<<" Ak= "<<A[i]<<" Ak-1= "<<A[i-1]<<" K= "<<i;
    return a.exec();
}
